from datetime import datetime,timedelta
import jwt

class JWTTool:
    def get_token(self,userid):
        exp=datetime.utcnow()+timedelta(days=1)
        payload={
            "userid":userid,
            'exp':exp
        }
        key='123'
        return jwt.encode(key=key, payload=payload, algorithm="HS256")

tool = JWTTool()
